Seu código funcionou sem problemas aqui.
TFS 1.1
:mel:
Seu código funcionou sem problemas aqui.
TFS 1.1
:mel:
info
Grupo: Marquês
Registrado: 03/02/13
Posts: 1.2k
Reputação: +254
Gênero: Masculino
Char no Tibia: Partiu Baladinha

Tente:
local holeId = {
294, 369, 370, 383, 392, 408, 409, 410, 427, 428, 430, 462, 469, 470, 482,
484, 485, 489, 924, 3135, 3136, 7933, 7938, 8170, 8286, 8285, 8284, 8281,
8280, 8279, 8277, 8276, 8323, 8567, 8585, 8596, 8595, 8249, 8250, 8251,
8252, 8253, 8254, 8255, 8256, 8972, 9606, 9625, 13190, 14461, 19519, 21536
}
function onUse(player, item, fromPosition, itemEx, toPosition)
local tile = toPosition:getTile()
if isInArray(ropeSpots, tile:getGround():getId()) or tile:getItemById(14435) then
player:teleportTo({x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1}, false)
return true
elseif isInArray(holeId, itemEx.itemid) then
toPosition.z = toPosition.z + 1
tile = toPosition:getTile()
if tile then
local thing = tile:getTopVisibleThing()
if thing:isItem() and thing:getType():isMovable() then
return thing:moveTo({x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1})
end
end
return player:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
end
return false
end
info
Grupo: Campones
Registrado: 14/02/07
Posts: 74
Reputação: +11
Gênero: Masculino

Seu código funcionou sem problemas aqui.
TFS 1.1
:mellow:
Ele funciona , mas aparece esse erro em alguma situação no servidor.
Eu vou testar ele aqui, mas eu preciso de uns 2 a 4 dias para ver se ele não vai mais o erro no console, porque esse erro é um erro que dá em alguma situação especial que eu ainda não descobri,
Dei rep pra vcs pela ajuda, daqui a uns 2 a 4 dias eu volto e falo pra vc se funcionou, ja deixo meu obrigado aqui ^^.
Vlws!!
info
Grupo: Campones
Registrado: 14/02/07
Posts: 74
Reputação: +11
Gênero: Masculino

Tente:
local holeId = { 294, 369, 370, 383, 392, 408, 409, 410, 427, 428, 430, 462, 469, 470, 482, 484, 485, 489, 924, 3135, 3136, 7933, 7938, 8170, 8286, 8285, 8284, 8281, 8280, 8279, 8277, 8276, 8323, 8567, 8585, 8596, 8595, 8249, 8250, 8251, 8252, 8253, 8254, 8255, 8256, 8972, 9606, 9625, 13190, 14461, 19519, 21536 } function onUse(player, item, fromPosition, itemEx, toPosition) local tile = toPosition:getTile() if isInArray(ropeSpots, tile:getGround():getId()) or tile:getItemById(14435) then player:teleportTo({x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1}, false) return true elseif isInArray(holeId, itemEx.itemid) then toPosition.z = toPosition.z + 1 tile = toPosition:getTile() if tile then local thing = tile:getTopVisibleThing() if thing:isItem() and thing:getType():isMovable() then return thing:moveTo({x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1}) end end return player:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE) end return false end
Tive que esperar alguns dias para ver se o erro não aparecia, mas ele apareceu de novo..
Lua Script Error: [Action Interface]
data/actions/scripts/tools/rope.lua:onUse
data/actions/scripts/tools/rope.lua:11: attempt to index local 'tile' (a nil value)
stack traceback:
[C]: in function '__index'
data/actions/scripts/tools/rope.lua:11: in function
info
Grupo: Campones
Registrado: 14/02/07
Posts: 74
Reputação: +11
Gênero: Masculino
Ola pessoal , estou rodando meu servidor e venho percebendo que de vez em quando aparece um erro no rope.lua. Ele está funcionando mas aparece um erro no meu log, é um erro que não ocorre sempre e eu ainda não consegui ver quem era ou o que é esse evento que faz dar esse erro, poderiam me ajudar ?, segue a baixo:
Erro:
Rope.lua
294, 369, 370, 383, 392, 408, 409, 410, 427, 428, 430, 462, 469, 470, 482,
484, 485, 489, 924, 3135, 3136, 7933, 7938, 8170, 8286, 8285, 8284, 8281,
8280, 8279, 8277, 8276, 8323, 8567, 8585, 8596, 8595, 8249, 8250, 8251,
8252, 8253, 8254, 8255, 8256, 8972, 9606, 9625, 13190, 14461, 19519, 21536
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local tile = toPosition:getTile()
if isInArray(ropeSpots, tile:getGround():getId()) or tile:getItemById(14435) then
Player(cid):teleportTo({x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1}, false)
return true
elseif isInArray(holeId, itemEx.itemid) then
toPosition.z = toPosition.z + 1
tile = toPosition:getTile()
if tile then
local thing = tile:getTopVisibleThing()
if thing:isItem() and thing:getType():isMovable() then
return thing:moveTo({x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1})
end
end
return Player(cid):sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
end
return false
Editado Janeiro 15 por Assasin